#include <iostream>
#include <queue>
#include <cstring>

using namespace std;

typedef pair<int, int> PII;

const int N = 25;
int d[N][N];
int x1, x2, y1, y2;
int dx[] = {-2, -2, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2};
int dy[] = {0, 1, 2, 2, 2, 2, 2, 1, 0, -1, -2, -2, -2, -2, -2, -1};

void dfs(int x, int y)
{
	queue<PII> q;
	q.push({x, y});
	d[x][y] = 0;
//	if(x == 1 && y == 1) return;
	while(q.size())
	{
		auto t = q.front(); q.pop();
		int i = t.first, j = t.second;
		for(int k = 0; k < 16; k++)
		{
			int x = i + dx[k], y = j + dy[k];
			if(x < 1 || x > 20 || y > 20 || y < 1) continue;
			if(d[x][y] == -1) 
			{
				d[x][y] = d[i][j] + 1;
				if(x == 1 && y == 1) return;
				q.push({x, y});
			}
		}
	}
}

int main()
{
	cin >> x1 >> y1 >> x2 >> y2;
	memset(d, -1, sizeof d);
	dfs(x1, y1);
	cout << d[1][1] << endl;
	memset(d, -1, sizeof d);
	dfs(x2, y2);
	cout << d[1][1] << endl;
	return 0;
}
